An operating system (OS) is a set of programs that manage computer hardware resources and provide common services for application software. For hardware functions such as input and output and memory allocation, the operating system typically acts as an intermediary between application programs and hardware. Operating systems may be found on a variety of devices, including desktop computers, servers, smartphones, video game consoles, and so forth.
Operating systems typically provide one or more mechanisms for interprocess communication (i.e., sending data from one process to another.) Two such mechanisms are typically employed when there is a need to send large amounts of data: shared memory, and pipes. In the shared memory approach, a chunk of memory is made accessible to both a sending process and a receiving process, enabling efficient access to memory by both processes without requiring any copying. This approach, however, suffers from potential security and reliability issues, as malicious or malfunctioning processes are granted access to a large amount of memory and may alter its contents with undesirable consequences.
In the pipe approach, a sending process designates a first area of memory containing data to be sent, and a receiving process designates a second area of memory where the data is to be placed, and the operating system copies the data from the sending process to the receiving process. This approach is more reliable than using shared memory; however it incurs two copies, which reduces efficiency.